<?php
require 'core/header.php';
if ( isset( $_SESSION['uid'] ) ) {
	if ( $_SESSION['rank'] != '10' ) {
		header( 'Location:forum.php' );
	}
}
?>
    <h3>用户登录</h3>
    <form method="post" action="post.php">
        <p>
            用户名: <input id="username" name="username" type="text" value=""/>
        </p>
        <p>
            密&nbsp;&nbsp;&nbsp;码: <input id="password" name="password" type="password" value=""/>
        </p>
        <p>
            验证码：<input id="verify" name="verify" type="text" value=""/><img id="verifyImg" style="-webkit-user-select: none;" src="core/verification.php"><a href="javascript:void(0)" onclick="document.getElementById('verifyImg').src='core/verification.php?r='+Math.random()">换一张</a>
            <!-- ?r='+Math.random() -->
        </p>
        <input type="button" onclick="history.go(-1)" value="返回">
		<?php
		if ( isset( $_GET['back'] ) ) {
			?>
            <input name="submit" type="button" onclick="ajaxpost_login(<?= $_GET['back'] ?>, 1)" value="登录"/>
			<?php
		} else {
			?>
            <input name="submit" type="button" onclick="ajaxpost_login('forum.php', 0)" value="登录"/>
			<?php
		}

		?>
        <a href="signin.php">没有账号，注册</a>
    </form>
<?php
require 'core/footer.php';
?>